<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
    <style>
        /*@page {*/
        /*    size: 297mm 210mm;*/
        /*    margin: 0;*/
        /*    padding: 0;*/
        /*}*/

        body {
            text-align: center;
            font-family: SimSun;
            font-size: 10px;
            word-wrap: break-word; /* 当内容超出单元格宽度时进行换行 */
        }

        .title {
            font-family: SimSun;
            font-size: 20px;
            font-weight: bold;
            text-align: left;
        }

        .title2 {
            font-family: SimSun;
            font-size: 18px;
            font-weight: bold;
            text-align: left;
        }

        .headTdLable {
            text-align: left;
            color: gray;
        }

        .headTdVal {
            text-align: left;
        }

        .tdContentLeft {
            text-align: left;
        }

        .mxTable td, th {
            /*border: 0.1px solid black; !*设置边框样式、颜色和大小*!*/
        }

        .detailLine {
            height: 75px;
        }

        .detailLineTitle {
            font-size: 10px;
            height: 50px;
            text-align: center;
            color: gray;
        }

        .divPage {
            /*border: 1px solid #000;*/
            height: 205mm;
        }

        /* 头部内容样式 -------------------------------------===============================================*/
        .headTable {
            border-collapse: collapse;
            width: 100%;
            margin: 0 auto;
            border-top: 3px solid black;
            border-left: none;
            border-right: none;
            border-bottom: 1px solid #000;
        }

        .headTable td {
            padding: 8px;
            border-top: 1px solid #ddd;
            border-bottom: 1px solid #ddd;
            border-left: none;
            border-right: none;
            /*position: relative;*/
        }

        .headTable td:not(:last-child)::after {
            content: "";
            position: absolute;
            right: 0;
            top: 0;
            height: 100%;
            width: 1px;
            background-color: #ddd;
        }

        .headTable tr:first-child td {
            border-top: none;
        }

        .headTable tr:last-child td {
            border-bottom: none;
        }

        /* 头部内容样式 ===============================================-------------------------------------*/
    </style>

</head>
<body>
<#escape x as x?html>
    <!-- 文件头-列宽设置 -->
    <#assign columnt1= 17  />
    <#assign columnt3= 17  />
    <#assign columnt2= (100 - (columnt1 * 2))/2  />
    <#assign columnt4=  100 - columnt2 />

<#--模块间隔-->
    <#assign topSpacing= 15  />
    <#assign bodySpacing= 30  />
    <#assign topPageSpacing= 30  />
<#--主体部分行高-->
    <#assign bodyLineHeight= 40  />

    <!--begin 凭证信息 每页显示多条条数据-->
    <#assign voucherPageSize=6 />
    <#assign voucherPageSizeBody=11 />
    <!-- 明细-列宽设置 -->
    <#assign voucherColumntZb=  columnt1 + columnt2 />
    <#assign voucherColumnt=  (100-voucherColumntZb) /2 />
    <!--=end= 凭证信息 每页显示多条条数据-->

<#--    记录总页数-->
    <#assign pageNoTotal = 1 />

<#--  begin 计算凭证一共有多少页-->
    <#assign voucherPageNoTotal= 0 />
    <#assign voucherNoMark= false />
    <#if details?exists  >
        <#if details?is_string >
        <#elseif details?size != 0>
            <#assign voucherNoMark= true />
            <#if voucherPageSize lt details?size>
                <#assign voucherPageNoTotal= ((details?size - voucherPageSize)/voucherPageSizeBody)?ceiling />
            </#if>
        </#if>
    </#if>
<#--    记录总页数-->
    <#assign pageNoTotal = pageNoTotal + voucherPageNoTotal/>
<#--  =end= 计算凭证一共有多少页-->


<#-- begin 计算明细总页数-->
    <#assign detailPageNoTotal= 1 />
    <#assign detailPageSize= 10 />  <#-- 评论-->
    <#assign field_1Mark = false/>
    <#if comment_list?exists   >
        <#if comment_list?is_string >
        <#elseif comment_list?size != 0>
            <#assign field_1Mark = true/>
            <#assign detailPageNoTotal=(comment_list?size/detailPageSize)?ceiling />
        </#if>
    </#if>
<#--    记录总页数-->
    <#assign pageNoTotal = pageNoTotal+ detailPageNoTotal/>

<#--    发票-->
    <#assign glfpPageNoTotal= 1 />
    <#assign referenceInvoiceMark = false/>
    <#if task_list?exists   >
        <#if task_list?is_string >
        <#elseif task_list?size != 0>
            <#assign referenceInvoiceMark = true/>
            <#assign glfpPageNoTotal=(task_list?size/detailPageSize)?ceiling />
        </#if>
    </#if>
<#--    记录总页数-->
    <#assign pageNoTotal = pageNoTotal+ glfpPageNoTotal/>

<#--  =end= 计算明细总页数-->

    <div style="margin-top:0 ; width: 100%;" class="divPage">
        <#--  BEGIN =============================第一页内容============================-->
        <div>
            <#--    顶部预留空间-->
            <div style="height: ${topSpacing}px">
            </div>
            <#--        页码-->
            <div style="width:100%;text-align:right">
                1/${pageNoTotal}
            </div>
            <#--        标题-->
            <div class="title" style="width: 100%; ">
                SRM-采购入库单
            </div>
            <div style="height: ${bodySpacing}px">
            </div>

            <#--    BEGIN 单据表头信息-->
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="headTable" style="font-size: 14px;">
                <colgroup>
                    <col width="${columnt1}%"/>
                    <col width="${columnt2}%"/>
                    <col width="${columnt3}%"/>
                    <col width="${columnt4}%"/>
                </colgroup>
                <tr style="height: ${bodyLineHeight}px">
                    <td class="headTdLable">主体</td>
                    <td class="headTdVal">${orgcode!""}</td>
                    <td class="headTdLable">采购申请单单号</td>
                    <td class="headTdVal">${order_no!""}</td>
                </tr>
                <tr style="height: ${bodyLineHeight}px">
                    <td class="headTdLable">申请单类型</td>
                    <td class="headTdVal">${pr_type_code!""}</td>
                    <td class="headTdLable">项目名称</td>
                    <td class="headTdVal">${pr_title!""}</td>
                </tr>
                <tr style="height: ${bodyLineHeight}px">
                    <td class="headTdLable">原币</td>
                    <td class="headTdVal">
                        <#if amounts?exists>
                            <#assign tmpNumber = (amounts)?number >
                            <#if tmpNumber gt 1000>
                                ${tmpNumber?string('0,000.00')}
                            <#else >
                                ${tmpNumber?string('0.00')}
                            </#if>
                        </#if>
                    </td>
                    <td class="headTdLable">本币</td>
                    <td class="headTdVal">
                        <#if amounts_rmb?exists>
                            <#assign tmpNumber = (amounts_rmb)?number >
                            <#if tmpNumber gt 1000>
                                ${tmpNumber?string('0,000.00')}
                            <#else >
                                ${tmpNumber?string('0.00')}
                            </#if>
                        </#if>
                    </td>
                </tr>
                <tr style="height: ${bodyLineHeight}px">
                    <td class="headTdLable">币种</td>
                    <td class="headTdVal">${currency!""}</td>
                    <td class="headTdLable">采购员</td>
                    <td class="headTdVal">${pr_user!""}</td>
                </tr>
                <tr style="height: ${bodyLineHeight}px">
                    <td class="headTdLable">创建人</td>
                    <td class="headTdVal">${create_user!""}</td>
                    <td class="headTdLable">创建时间</td>
                    <td class="headTdVal">${create_time!""}</td>
                </tr>
                <tr style="height: 75px">
                    <td class="headTdLable">备注</td>
                    <td class="headTdVal" colspan="3" style="font-size: 12px;">>${remark!""}</td>
                </tr>
            </table>
            <#--    =END= 单据表头信息-->
            <#--        内容间隔-->
            <div style="height: ${topPageSpacing}px">
            </div>
            <#--  BEGIN =====================凭证明细信息显示====================-->
            <#assign cgddCH1=   6   />
            <#assign cgddCH3=   10   />
            <#assign cgddCH4=   15   />
            <#assign cgddCH5=   15   />
            <#assign cgddCH6=   20   />
            <#assign cgddCH2= 100 - cgddCH1 - cgddCH3  - cgddCH4  - cgddCH5 - cgddCH6 />
            <div style="page-break-after:always;" class="div">

                <div width="100%" id="myDiv">
                    <div class="title2" style="width: 100%; ">
                        明细
                    </div>
                    <br/>
                    <table width="100%" border="0" cellspacing="0" cellpadding="3" class="headTable">
                        <colgroup>
                            <col width="${cgddCH1}%"/>
                            <col width="${cgddCH2}%"/>
                            <col width="${cgddCH3}%"/>
                            <col width="${cgddCH4}%"/>
                            <col width="${cgddCH5}%"/>
                            <col width="${cgddCH6}%"/>
                        </colgroup>
                        <#--   <tr class="detailLineTitle">
                               <td>1</td>
                               <td>2</td>
                               <td>3</td>
                               <td>4</td>
                               <td>5</td>
                               <td>6</td>
                           </tr>-->
                        <tr class="detailLineTitle">
                            <td>行号</td>
                            <td>商品名称</td>
                            <td>数量</td>
                            <td>含税金额</td>
                            <td>成本中心</td>
                            <td>店铺</td>
                        </tr>
                        <#if voucherNoMark  >
                            <#if 1 * voucherPageSize gt details?size>
                                <#assign end= details?size -1 />
                            <#else>
                                <#assign end= 1*voucherPageSize-1 />
                            </#if>
                            <#list 0..end as i>
                                <#assign line=details[i] />
                                <tr class="detailLine">
                                    <td>${line.line_no!""}</td>
                                    <td>${line.goods_name!""}</td>
                                    <td>${line.num!""}</td>
                                    <td>
                                        <#if line.bb_notax_de?exists>
                                            <#assign tmpNumber = (line.bb_notax_de)?number >
                                            <#if tmpNumber gt 1000>

                                                ${tmpNumber?string('0,000.00')}
                                            <#else >

                                                ${tmpNumber?string('0.00')}
                                            </#if>
                                        </#if>
                                    </td>
                                    <td>${line.cost_center!""}</td>
                                    <td>${line.shop_name!""}</td>
                                </tr>
                            </#list>
                        <#else >
                            <tr class="detailLine">
                                <td colspan="10">无明细数据</td>
                            </tr>
                        </#if>
                    </table>
                </div>
            </div>
            <#--  =END= =====================凭证明细信息显示====================-->
        </div>
        <#--  =END= =============================第一页内容============================-->

        <#--  BEGIN =============================后续凭证明细信息显示============================-->
        <#if voucherNoMark  >
            <#if voucherPageSize lt details?size>
                <#assign pageNoTotalSurplus = voucherPageNoTotal />
                <#list 1..pageNoTotalSurplus as c>
                    <div <#if c != pageNoTotalSurplus >style="page-break-after:always;"</#if>>
                        <#if (c*voucherPageSizeBody + voucherPageSize) gt details?size>
                            <#assign end = details?size-1 />
                        <#else>
                            <#assign end = (c)*voucherPageSizeBody + voucherPageSize -1 />
                        </#if>

                        <#-- BEGIN 分页顶部空余和分页数据-->
                        <div style="height: ${topSpacing}px">
                        </div>
                        <div style="width:100%;text-align:right">
                            ${c+1}/${pageNoTotal}
                        </div>
                        <div style="height: ${topSpacing}px">
                        </div>
                        <#-- =END= 分页顶部空余和分页数据-->

                        <div width="100%" id="myDiv">
                            <table width="100%" border="0" cellspacing="0" cellpadding="3" class="headTable">
                                <colgroup>
                                    <col width="${cgddCH1}%"/>
                                    <col width="${cgddCH2}%"/>
                                    <col width="${cgddCH3}%"/>
                                    <col width="${cgddCH4}%"/>
                                    <col width="${cgddCH5}%"/>
                                    <col width="${cgddCH6}%"/>
                                </colgroup>
                                <#list ((c-1) * voucherPageSizeBody  + voucherPageSize )..end as i>
                                    <#assign line=details[i] />
                                    <tr class="detailLine">
                                        <td>${line.line_no!""}</td>
                                        <td>${line.goods_name!""}</td>
                                        <td>${line.num!""}</td>
                                        <td>
                                            <#if line.bb_notax_de?exists>
                                                <#assign tmpNumber = (line.bb_notax_de)?number >
                                                <#if tmpNumber gt 1000>

                                                    ${tmpNumber?string('0,000.00')}
                                                <#else >

                                                    ${tmpNumber?string('0.00')}
                                                </#if>
                                            </#if>
                                        </td>
                                        <td>${line.cost_center!""}</td>
                                        <td>${line.shop_name!""}</td>
                                    </tr>
                                </#list>
                            </table>
                        </div>
                    </div>

                </#list>
            <#--    =end=        第2页循环明细行-->
            </#if>
        </#if>
        <#--  =END= =============================后续凭证明细信息显示============================-->


        <#--  BEGIN =============================[关联发票]费用明细信息显示============================-->
        <#list 1..glfpPageNoTotal as c>
            <div style="page-break-after:always;">
            </div>
            <div style="page-break-after:always;">
                <#--            begin            分页顶部空余和分页数据-->
                <div style="height: ${topSpacing}px">
                </div>
                <div style="width:100%;text-align:right">
                    ${c + 1 + voucherPageNoTotal}/${pageNoTotal}
                </div>
                <div style="height: ${topSpacing}px">
                </div>
                <#--            =end=            分页顶部空余和分页数据-->

                <div width="100%" id="myDiv">
                    <div class="title2" style="width: 100%; ">
                        审批明细
                    </div>
                    <br/>
                    <table width="100%" border="0" cellspacing="0" cellpadding="3" class="headTable">
                        <colgroup>
                            <col width="14%"/>
                            <col width="14%"/>
                            <col width="41%"/>
                            <col width="14%"/>
                            <col width="17%"/>
                        </colgroup>
                        <#if c == 1 >
                            <tr class="detailLineTitle">
                                <td>用户名称</td>
                                <td>审批状态</td>
                                <td>审批意见</td>
                                <td>节点名称</td>
                                <td>开始时间</td>
                            </tr>
                        </#if>
                        <#if referenceInvoiceMark >
                            <#if c * detailPageSize gt task_list?size>
                                <#assign end = task_list?size-1 />
                            <#else>
                                <#assign end= c * detailPageSize -1 />
                            </#if>
                            <#list ((c - 1) * detailPageSize )..end as i>
                                <#assign line=task_list[i] />
                                <tr class="detailLine">
                                    <td>${line.user_name!""}</td>
                                    <td>${line.status!""}</td>
                                    <td class="tdContentLeft">${line.approval_opinions!""}</td>
                                    <td>${line.node_name!""}</td>
                                    <td>${line.start_time!""}</td>
                                </tr>
                            </#list>
                        <#else >
                            <tr class="detailLine">
                                <td colspan="5">无明细数据</td>
                            </tr>
                        </#if>
                    </table>
                </div>
            </div>
        </#list>
        <#--  =END= =============================[关联发票]费用明细信息显示============================-->

        <#--  BEGIN =============================费用明细信息显示============================-->
        <#list 1..detailPageNoTotal as c>
            <!-- 明细-列宽设置 -->
            <div style="page-break-after:always;">
            </div>
            <div style="page-break-after:always;">
                <#--            begin            分页顶部空余和分页数据-->
                <div style="height: ${topSpacing}px">
                </div>
                <div style="width:100%;text-align:right">
                    ${c + 1 +  voucherPageNoTotal + glfpPageNoTotal}/${pageNoTotal}
                </div>
                <div style="height: ${topSpacing}px">
                </div>
                <#--            =end=            分页顶部空余和分页数据-->
                <#assign pl1= 15  />
                <#assign pl3= 25  />
                <#assign pl2= (100 - pl1 - pl3 )/>

                <div width="100%" id="myDiv">
                    <div class="title2" style="width: 100%; ">
                        评论明细
                    </div>
                    <br/>
                    <table width="100%" border="0" cellspacing="0" cellpadding="3" class="headTable">
                        <colgroup>
                            <col width="${pl1}%"/>
                            <col width="${pl2}%"/>
                            <col width="${pl3}%"/>
                        </colgroup>
                        <#if c == 1 >
                            <tr class="detailLineTitle">
                                <td>用户名称</td>
                                <td>评论内容</td>
                                <td>评论创建时间</td>
                            </tr>
                        </#if>
                        <#if field_1Mark >
                            <#if c * detailPageSize gt comment_list?size>
                                <#assign end = comment_list?size-1 />
                            <#else>
                                <#assign end= c * detailPageSize -1 />
                            </#if>
                            <#list ((c - 1) * detailPageSize )..end as i>
                                <#assign line=comment_list[i] />
                                <tr class="detailLine">
                                    <td>${line.user_name!""}</td>
                                    <td class="tdContentLeft">${line.comment!""}</td>
                                    <td>${line.create_time!""}</td>
                                </tr>
                            </#list>
                        <#else >
                            <tr class="detailLine">
                                <td colspan="3">无明细数据</td>
                            </tr>
                        </#if>
                    </table>
                </div>
            </div>
        </#list>
        <#--  =END= =============================费用明细信息显示============================-->

    </div>
</#escape>
</body>
</html>